CentOS8 に nodejs v12 を入れる
追記: この記事の方法は非推奨で、個人的最適解はnodejsを入れるです。ビルドもいらないから速いし
NodeSource で入れる手筈だったが、Issue Support RHEL8 / CentOS 8 / UBI · Issue #845 · nodesource/distributions で上がっている通り、python2 あたりへの依存関係に対する対応がまだされておらず yum install でインストールすることができない。node-gyp あたりへの依存とか聞いたが、実にかったるい…
code:bash
$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
$ sudo yum install nodejs --disablerepo=AppStream
エラー:
問題: conflicting requests
- nothing provides python >= 2.6 needed by nodejs-2:12.13.1-1nodesource.x86_64
- nothing provides /usr/bin/python needed by nodejs-2:12.13.1-1nodesource.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
なので、こうする
code:bash
$ sudo yum install -y python2 yum-utils
$ sudo yumdownloader nodejs --disablerepo=AppStream
$ sudo rpm -ivh --nodeps nodejstab
[tab] というのはタブキーを押して補完するようにという意味なので間違えないように。
#blog #nodejs #CentOS